Update "Route to a destination" sample to use new Azure Maps API version 2025-01-01#183
Merged
Update "Route to a destination" sample to use new Azure Maps API version 2025-01-01#183
Conversation
…1 with POST method Co-authored-by: dubiety <3462778+dubiety@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] "Route to a destination" sample uses deprecated API version
Update "Route to a destination" sample to use new Azure Maps API version 2025-01-01
Jul 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Route to a destination" tutorial sample was using the deprecated Azure Maps Route API version 1.0, which is scheduled for retirement. This PR updates the sample to use the current API version 2025-01-01 with the new POST-based methodology.
Changes Made
API Version Update
api-version=1.0(deprecated)api-version=2025-01-01(current)HTTP Method Change
URL Structure
https://{azMapsDomain}/route/directions/json?api-version=1.0&query={query}&routeRepresentation=polyline&travelMode=car&view=Autohttps://{azMapsDomain}/route/directions?api-version=2025-01-01Request Format
startLat,startLon:endLat,endLon)Implementation Details
processRequest()withprocessPostRequest()pointIndexandpointType: "waypoint"properties to route pointsoptimizeRoute,routeOutputOptions,maxRouteCount,travelModeThe sample now follows the current Azure Maps Route API standards and will continue working when the deprecated API version is retired.
Fixes #180.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.